 /**
  * ESUI (Enterprise Simple UI)
  * Copyright 2013 Baidu Inc. All rights reserved.
  *
  * @file 日程样式
  * @author miaojian
  */

@import "Variable.less";

@esui-schedule-padding: 1em;
@esui-schedule-head-margin: 1em 0 0 0;
@esui-schedule-help-item-right-margin: .5em;
@esui-schedule-legend-size: 1em;
@esui-schedule-slot-size: 2em;
@esui-schedule-day-header-width: 3em;
@esui-schedule-shortcut-item-padding: 0 1em;
@esui-schedule-shortcut-item-right-margin: .5em;
@esui-schedule-shortcut-item-border-radius: 0;
@esui-schedule-shortcut-time-line-left-padding: 3.5em;
@esui-schedule-tip-padding: .5em;
@esui-schedule-tip-zIndex: @dialog-z-index;

.@{ui-class-prefix}-schedule {
    padding: @esui-schedule-padding;
    position: relative;
    display: inline-block;
    outline: 0;
    .esui-schedule-theme();
    &.@{ui-state-prefix}-disabled {
        .esui-disabled();
    }
}

// 测试slot的宽度的容器
.@{ui-class-prefix}-schedule-slot-tester {
    width: @esui-schedule-slot-size;
}

.@{ui-class-prefix}-schedule-body,
.@{ui-class-prefix}-schedule-head {
    &:extend(.esui-clearfix all);
}

// 主区域下方的快速设定容器和图例容器
.@{ui-class-prefix}-schedule-head {
    margin: @esui-schedule-head-margin;
}

// 快速设定
.@{ui-class-prefix}-schedule-shortcut {
    float: left;
    span {
        display: inline-block;
    }
}

// 快速设定按钮
.@{ui-class-prefix}-schedule-shortcut-item {
    cursor: pointer;
    padding: @esui-schedule-shortcut-item-padding;
    margin-right: @esui-schedule-shortcut-item-right-margin;
    .esui-border-radius(
        @esui-schedule-shortcut-item-border-radius,
        @esui-schedule-shortcut-item-border-radius
    );
    .esui-schedule-shortcut-item-theme();
}

// 图例容器
.@{ui-class-prefix}-schedule-help {
    float: right;
    div {
        display: inline-block;
        margin-left: @esui-schedule-help-item-right-margin;
        vertical-align: middle;
    }
}

// 图例
.@{ui-class-prefix}-schedule-help-selected,
.@{ui-class-prefix}-schedule-help-unselected {
    .size(@esui-schedule-legend-size);
}

// 主区域上方的小时Label容器
.@{ui-class-prefix}-schedule-time-line {
    padding-left: @esui-schedule-day-header-width;
    overflow: hidden;
}

.@{ui-class-prefix}-schedule-time-line-inner {
    margin-left: -@esui-schedule-slot-size;
}

// 小时Label宽度
.@{ui-class-prefix}-schedule-time-head {
    width: @esui-schedule-slot-size * 2;
    text-align: center;
    float: left;
}

.@{ui-class-prefix}-schedule-time-head:last-child {
    width: auto;
    margin-left: @esui-schedule-slot-size/2;
}

// 主区域日期列
.@{ui-class-prefix}-schedule-day-head {
    float: left;
    width: @esui-schedule-day-header-width;
}

// 日期Checkbox行高度
.@{ui-class-prefix}-schedule-day {
    line-height: @esui-schedule-slot-size;
    input {
        display: none;
    }
    label {
        cursor: pointer;
    }
}

// 小时选择区域
.@{ui-class-prefix}-schedule-line {
    position: relative;
    // 清除浮动
    overflow: hidden;
}

// 小时正方形选择
.@{ui-class-prefix}-schedule-time {
    cursor: pointer;
    float: left;
    position: relative;
    .size(@esui-schedule-slot-size);
    .box-sizing(border-box);
}

.@{ui-class-prefix}-schedule-time-body {
    float: left;
    position: relative;
    .esui-schedule-time-body-theme();
}

.@{ui-class-prefix}-schedule-time,
.@{ui-class-prefix}-schedule-help-unselected {
    .esui-schedule-unselected-slot-theme();
}

.@{ui-class-prefix}-schedule-time-selected,
.@{ui-class-prefix}-schedule-help-selected {
    .esui-schedule-selected-slot-theme();
}

.@{ui-class-prefix}-schedule-time-hover {
    .esui-schedule-time-hover-theme();
}

.@{ui-class-prefix}-schedule-shortcut-item-tip,
.@{ui-class-prefix}-schedule-timeitem-tip {
    z-index: @esui-schedule-tip-zIndex;
    padding: @esui-schedule-tip-padding;
    .esui-schedule-tip-theme();
}

.@{ui-class-prefix}-schedule-follow-item {
    position: absolute;
    top: 0px;
    left: 0px;
    display: none;
    z-index: 49;
    .esui-schedule-schedule-follow-item-theme();
}

.@{ui-class-prefix}-schedule-continue-covertimes {
    height: @esui-schedule-slot-size;
    line-height: @esui-schedule-slot-size;
    position: absolute;
    .esui-schedule-continue-covertimes-theme();
}

.@{ui-class-prefix}-schedule-covertimes-tip {
    text-align: center;
}

// 不可用状态
.@{ui-class-prefix}-schedule.@{ui-state-prefix}-disabled {
    .@{ui-class-prefix}-schedule-time,
    .@{ui-class-prefix}-schedule-shortcut-item {
        cursor: not-allowed;
    }
}

// 只读
.@{ui-class-prefix}-schedule.@{ui-state-prefix}-read-only {
    .esui-schedule-read-only-theme();
    .@{ui-class-prefix}-schedule-time,
    .@{ui-class-prefix}-schedule-shortcut-item {
        cursor: default;
    }
}

.esui-schedule-theme() {}
.esui-schedule-shortcut-item-theme() {}
.esui-schedule-time-body-theme() {}
.esui-schedule-selected-slot-theme() {}
.esui-schedule-unselected-slot-theme() {}
.esui-schedule-time-hover-theme() {}
.esui-schedule-tip-theme() {}
.esui-schedule-schedule-follow-item-theme() {}
.esui-schedule-continue-covertimes-theme() {}
.esui-schedule-read-only-theme() {}
